/*
2GWVS a free web vulnerability scanner.
Copyright (C) 2008  Grigis Gaetan

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#ifndef _ISSUESEXECUTER_H_
#define _ISSUESEXECUTER_H_

#include <QHttp>
#include <QList>
#include <QPair>
#include "formCatched.h"
#include "urlCatched.h"
#include "issuesDatabase.h"
class FormCatched;
class issuesExecuter : public QObject {
	Q_OBJECT
	private:
		int base_url;
		int id_issue;
		int status;
                int current_parameter;
                int method;
                FormCatched *current_form;
		QUrl current_url;
		QUrl modified_url;
		QHttp *http;
		QString requestToExecute;
		QString testedFile;
		QStringList testedParam;
		
	public slots:
		void getExecution();
		
	public:
                static void launchAttack(int method=0);//0 = GET 1 = POST ... 2 = COOKIE ???
                issuesExecuter(int u,int i,int m=0);
		~issuesExecuter();
                void execute();             //GET
                void executePost();         //POST
                bool parseUrl(int index);   //GET
                bool parseForm(int index);  //POST
		static int currentExecutedIssues;
		static QList<issuesExecuter*> *allExecutedIssues;
};

#endif // !_ISSUESEXECUTER_H_
